package judesart.app.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.datanucleus.jpa.annotations.Extension;

@Entity
public class Room implements Serializable
{

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
    private String key;
    @ManyToOne
    private Gallery gallery;
    @Basic
    private Date createdAt;
    @Basic
    private String name;
    @Basic
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "room")
    private List<RoomArtwork> artworks;

    public String getKey()
    {
        return key;
    }

    public void setKey(String key)
    {
        this.key = key;
    }

    public Gallery getGallery()
    {
        return gallery;
    }

    public void setGallery(Gallery gallery)
    {
        this.gallery = gallery;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public List<RoomArtwork> getArtworks()
    {
        return artworks;
    }

    public void setArtworks(List<RoomArtwork> artworks)
    {
        this.artworks = artworks;
    }
}
